* switch to a suitable stack before jumping to compatibility mode.
* return the correct range for KEXEC_RANGE_MA_XEN.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
RELOCATE_SYM(idle_pg_table,%rax)
movq %rax, %cr3
+ /* Switch to identity mapped compatibility stack. */
+ RELOCATE_SYM(compat_stack,%rax)
+ movq %rax, %rsp
+
/* Save xen_phys_start for 32 bit code. */
movq xen_phys_start(%rip), %rbx
.long SYM_PHYS(compatibility_mode)
.long __HYPERVISOR_CS32
+ /*
+ * We use 5 words of stack for the arguments passed to the kernel. The
+ * kernel only uses 1 word before switching to its own stack. Allocate
+ * 16 words to give "plenty" of room.
+ */
+ .fill 16,4,0
+compat_stack:
+
.code32
#undef RELOCATE_SYM
static int kexec_get(xen)(xen_kexec_range_t *range)
{
+#ifdef CONFIG_X86_64
+ range->start = xenheap_phys_start;
+#else
range->start = virt_to_maddr(_start);
+#endif
range->size = (unsigned long)xenheap_phys_end - (unsigned long)range->start;
return 0;
}